package ccnu.agile.service;

import ccnu.agile.bean.request.Request;
import ccnu.agile.bean.response.Response;

public interface IBusinessService<Q extends Request, P extends Response> {

    /**
     * 业务前置参数校验
     *
     * @param request
     * @param response
     * @return
     */
    default void validate(Q request, P response) {
    }

    /**
     * 业务处理
     *
     * @param request
     * @param response
     */
    void doBusiness(Q request, P response);

    /**
     * 业务后置返回数据处理
     *
     * @param response
     */
    default void postBusiness(P response) {

    }
}
